package com.skyworth.web.admin.user.service;

import com.google.gson.JsonObject;
import com.skyworth.web.admin.user.domain.UserModel;
import com.skyworth.web.admin.user.form.UserForm;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.List;

/**
 * @author holin
 * @date 11/22/15.
 */

public interface UserService {

    public UserModel addUser(UserForm form);
    public UserModel updateUser(UserForm form);
    public UserModel updateUser(UserModel userModel);
    public void setStoreId(long id, long storeId);
    public void removeUser(long id);
    public UserModel findUser(long id);


    public boolean existsByMobile(String mobile, long store_id);
    public boolean existsByUsername(String username, long store_id);
    public boolean existsByEmployeeNo(String employeeNo, long store_id);


    public UserModel findUserByUsername(String username);
    public UserModel findUserByMobile(String mobile);
    public UserModel findUserByEmployeeNo(String employeeNo);
    public UserModel findUserByAccessToken(String accessToken);
    public List<UserModel> userList(JsonObject params);
    public List<UserModel> waiterList(long storeId);
    public Page<UserModel> userPage(JsonObject params);
    public Page<UserModel> userPage(JsonObject params,Pageable pageable);

    boolean existEmployee(String employeeNo, long id, long store_id);

    boolean existUser(String username, long id, long store_id);

    boolean existPhone(String mobile, long id, long store_id);

    boolean existsByUsername(String username);

    boolean existsByMobile(String mobile);
}
